Squid + SquidGuard
2015/05/17 |
Configure Squid + SquidGuard to set contents filtering.
|
|
[1] | Install SquidGuard. |
root@prox:~#
root@prox:~# aptitude -y install squidguard mv /etc/squidguard/squidGuard.conf /etc/squidguard/squidGuard.conf.org
root@prox:~#
vi /etc/squidguard/squidGuard.conf # create new
dbhome /var/lib/squidguard/db logdir /var/log/squidguard dest deny { # define prohibited domain list in 'deny' category domainlist deny/domains # define prohibited URL list in 'deny' category urllist deny/urls } acl { default { # permit all except 'deny' category pass !deny all # the redirected URL if matches 'deny' redirect http://www.srv.world/error.html } } mkdir /var/lib/squidguard/db/deny
root@prox:~#
vi /var/lib/squidguard/db/deny/domains # write domains you'd like to prohibit to access
yahoo.co.jp
example.com
root@prox:~#
vi /var/lib/squidguard/db/deny/urls # write URLs you'd like to prohibit to access
www.yahoo.co.jp/deny/
www.example.com/ squidGuard -C all 2015-05-18 22:26:23 [10938] INFO: squidGuard 1.5 started (1431955583.101) 2015-05-18 22:26:23 [10938] INFO: db update done 2015-05-18 22:26:23 [10938] INFO: squidGuard stopped (1431955583.142)
root@prox:~#
chown -R proxy. /var/lib/squidguard
root@prox:~#
vi /etc/squid3/squid.conf # line 4168: add
url_rewrite_program /usr/bin/squidGuard
systemctl restart squid3
|
[2] | Try to access to the URL you set as prohibited domains in [1]. |